<table *ngIf="tasks" class="border"
    style="width: 100%; min-width: 870px; text-align: center">
  <tr>
    <th>#</th>
    <th>项目</th>
    <th>阶段</th>
    <th>任务</th>
    <th>责任人</th>
    <th>开始日期</th>
    <th>结束日期</th>
    <th>工期</th>
    <th>工时</th>
    <th>加班工时</th>
    <th>任务状态</th>
  </tr>
  <tr *ngFor="let task of tasks; let i=index">
    <td>{{i + 1}}</td>
    <td style="text-align: left; padding: 0 8px;"><a href="projects/{{task.project_id}}"
        (click)="goProject(project_id)">{{task.project.name}}</a></td>
    <td>{{task.stage.name}}</td>
    <td style="text-align: left; padding: 0 8px;"><a href="tasks/{{task.id}}"
        (click)="goTask(task)">{{task.name}}</a></td>
    <td><a (click)="goUserTasks(task.receiver_id)"
        href="users/{{task.receiver_id}}/tasks"
      >{{task.receiver && task.receiver.name}}</a></td>
    <td>{{task.s_date}}</td>
    <td>{{task.e_date}}</td>
    <td>{{task.work_days}}工作日</td>
    <td>{{task.hours}}</td>
    <td>{{task.ot_hours}}</td>
    <td>
      <md-checkbox *ngIf="mine.id == task.receiver_id && !task.done"
          (change)="changeTask(task, 'processing')"
          [(ngModel)]="task.processing" >标记开始</md-checkbox>
      <span *ngIf="!task.done && mine.id != task.receiver_id">
        <span *ngIf="task.processing">已开始</span>
        <span *ngIf="!task.processing">未开始</span>
      </span>
      <span *ngIf="task.processing && !task.done">/</span>
      <md-checkbox *ngIf="mine.id == task.project.leader_id && task.processing"
          (change)="changeTask(task, 'done')"
          [(ngModel)]="task.done">标记完成</md-checkbox>
      <span *ngIf="task.processing && mine.id != task.project.leader_id">
        <span *ngIf="task.done">已完成</span>
        <span *ngIf="!task.done">未完成</span>
      </span>
    </td>
  </tr>
</table>
<p><br /></p><p><br /></p><p><br /></p>
<p><br /></p><p><br /></p><p><br /></p>
